package com.zoo.diannaopeijian.mapper;

import com.zoo.diannaopeijian.domain.Ware;
import com.zoo.diannaopeijian.domain.WareExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface WareMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ware
     *
     * @mbggenerated
     */
    @SelectProvider(type=WareSqlProvider.class, method="countByExample")
    int countByExample(WareExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ware
     *
     * @mbggenerated
     */
    @DeleteProvider(type=WareSqlProvider.class, method="deleteByExample")
    int deleteByExample(WareExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ware
     *
     * @mbggenerated
     */
    @Delete({
        "delete from ware",
        "where WareId = #{wareid,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer wareid);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ware
     *
     * @mbggenerated
     */
    @Insert({
        "insert into ware (WareId, WareName, ",
        "WareDescribe, Barcode)",
        "values (#{wareid,jdbcType=INTEGER}, #{warename,jdbcType=VARCHAR}, ",
        "#{waredescribe,jdbcType=VARCHAR}, #{barcode,jdbcType=VARCHAR})"
    })
    int insert(Ware record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ware
     *
     * @mbggenerated
     */
    @InsertProvider(type=WareSqlProvider.class, method="insertSelective")
    int insertSelective(Ware record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ware
     *
     * @mbggenerated
     */
    @SelectProvider(type=WareSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="WareId", property="wareid", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="WareName", property="warename", jdbcType=JdbcType.VARCHAR),
        @Result(column="WareDescribe", property="waredescribe", jdbcType=JdbcType.VARCHAR),
        @Result(column="Barcode", property="barcode", jdbcType=JdbcType.VARCHAR)
    })
    List<Ware> selectByExample(WareExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ware
     *
     * @mbggenerated
     */
    @Select({
        "select",
        "WareId, WareName, WareDescribe, Barcode",
        "from ware",
        "where WareId = #{wareid,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="WareId", property="wareid", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="WareName", property="warename", jdbcType=JdbcType.VARCHAR),
        @Result(column="WareDescribe", property="waredescribe", jdbcType=JdbcType.VARCHAR),
        @Result(column="Barcode", property="barcode", jdbcType=JdbcType.VARCHAR)
    })
    Ware selectByPrimaryKey(Integer wareid);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ware
     *
     * @mbggenerated
     */
    @UpdateProvider(type=WareSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") Ware record, @Param("example") WareExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ware
     *
     * @mbggenerated
     */
    @UpdateProvider(type=WareSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") Ware record, @Param("example") WareExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ware
     *
     * @mbggenerated
     */
    @UpdateProvider(type=WareSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(Ware record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ware
     *
     * @mbggenerated
     */
    @Update({
        "update ware",
        "set WareName = #{warename,jdbcType=VARCHAR},",
          "WareDescribe = #{waredescribe,jdbcType=VARCHAR},",
          "Barcode = #{barcode,jdbcType=VARCHAR}",
        "where WareId = #{wareid,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Ware record);

    @SelectProvider(type=WareSqlProvider.class, method="selectFuzzyWare")
    @Results({
            @Result(column="WareId", property="wareid", jdbcType=JdbcType.INTEGER, id=true),
            @Result(column="WareName", property="warename", jdbcType=JdbcType.VARCHAR),
            @Result(column="WareDescribe", property="waredescribe", jdbcType=JdbcType.VARCHAR),
            @Result(column="Barcode", property="barcode", jdbcType=JdbcType.VARCHAR)
    })
    List<Ware> selectFuzzyWare(Ware ware);

    @SelectProvider(type=WareSqlProvider.class, method="selectFuzzyOrWare")
    @Results({
            @Result(column="WareId", property="wareid", jdbcType=JdbcType.INTEGER, id=true),
            @Result(column="WareName", property="warename", jdbcType=JdbcType.VARCHAR),
            @Result(column="Barcode", property="barcode", jdbcType=JdbcType.VARCHAR)
    })
    List<Ware> selectFuzzyOrWare(Ware ware);
}